package com.gzq.learn.springbootdemo.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.gzq.learn.springbootdemo.domain.UserDTO;

@Component
@RabbitListener(queues = { "hello", "object", "topic.message", "topic.messages",
        "fanout.A", "fanout.B", "fanout.C" })
public class HelloReceiver {

    @RabbitHandler
    public void process(String message) {
        System.out.println("Receiver ： " + message);
    }

    @RabbitHandler
    public void process(UserDTO user) {
        System.out.println("Receiver Object ： " + user.toString());
    }
}
